module.exports = async function (ctx, next) {
    try {
        ctx.set('X-Proxy', 'Node Server');
        await next();
    } catch (err) {
        ctx.status = err.status || 500;
        ctx.body = 'Sorry. Internal server error occurred';
        ctx.app.emit('error', err, ctx);
    }
}